package a06oopextendsDemo;

//定义一个标准的javabean类
//先定义一个父类
public class Employee {
    //定义属性
    private String name;
    private String id;
    private double salary;

    //定义构造方法

    public Employee() {
    }

    public Employee(String name, String id, double salary) {
        this.name = name;
        this.id = id;
        this.salary = salary;
    }
    //定义get和set方法

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
    //定义其他的方法
    public void  work(){
        System.out.println(name+"正在工作");
    }
    public void eat(){
        System.out.println(name+"在吃米饭");
    }
}
